{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.读取CSV文件里的数据\n",
    "\n",
    "这里要注意一点，如果你的代码以来了自己自定义的莫快，需要使用sys.path.append添加\n",
    "项目根路径，不然的话，python执行会找不到模块，而且必须写在import之前。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "sys.path.append(os.path.abspath(os.path.join(os.getcwd(),\"../../\")))\n",
    "\n",
    "result_save_file = 'wzly.csv'\n",
    "raw_data = pd.read_csv(result_save_file)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.分析身高情况\n",
    "\n",
    "这里要对数据坐下清洗，流程如下：\n",
    "\n",
    "- （1）筛选140-200以内的身高\n",
    "- （2）将身高按照升序排列\n",
    "- （3）按照三个身高段，对数据进行分段处理，依次是140，150，160，170，180"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"2f902fde9c5a47269114ed54c0591dbd\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_2f902fde9c5a47269114ed54c0591dbd = echarts.init(document.getElementById('2f902fde9c5a47269114ed54c0591dbd'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_2f902fde9c5a47269114ed54c0591dbd = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u8eab\\u9ad8\\u5206\\u5e03\\u67f1\\u72b6\\u56fe\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 3331900,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u59b9\\u5b50\\u8eab\\u9ad8\",\n",
       "            \"data\": [\n",
       "                8.0,\n",
       "                3837.0,\n",
       "                9680.0,\n",
       "                789.0,\n",
       "                11.0\n",
       "            ],\n",
       "            \"barCategoryGap\": 0,\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 3331900\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u59b9\\u5b50\\u8eab\\u9ad8\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"140\",\n",
       "                \"150\",\n",
       "                \"160\",\n",
       "                \"170\",\n",
       "                \"180\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#61a0a8\",\n",
       "        \"#f6f5ec\",\n",
       "        \"#ca8622\",\n",
       "        \"#905a3d\",\n",
       "        \"#c23531\",\n",
       "        \"#f47920\",\n",
       "        \"#6950a1\",\n",
       "        \"#1d953f\",\n",
       "        \"#bda29a\",\n",
       "        \"#fab27b\",\n",
       "        \"#444693\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#6d8346\",\n",
       "        \"#2a5caa\",\n",
       "        \"#ac6767\",\n",
       "        \"#d48265\",\n",
       "        \"#6e7074\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#546570\",\n",
       "        \"#b2d235\",\n",
       "        \"#f05b72\",\n",
       "        \"#2f4554\",\n",
       "        \"#726930\",\n",
       "        \"#918597\",\n",
       "        \"#749f83\"\n",
       "    ]\n",
       "};\n",
       "myChart_2f902fde9c5a47269114ed54c0591dbd.setOption(option_2f902fde9c5a47269114ed54c0591dbd);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.bar.Bar at 0x596b030>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Bar\n",
    "\n",
    "# 身高范围\n",
    "height_interval = ['140', '150', '160', '170', '180']  \n",
    "\n",
    "# 分析身高\n",
    "def analysis_height(data):\n",
    "    height_data = data['身高']\n",
    "    height = (height_data.loc[(height_data > 140) & (height_data < 200)]).value_counts().sort_index()\n",
    "    height_count = [0, 0, 0, 0, 0]\n",
    "    for h in range(0, len(height)):\n",
    "        if 140 <= height.index[h] < 150:\n",
    "            height_count[0] += height.values[h]\n",
    "        elif 150 <= height.index[h] < 160:\n",
    "            height_count[1] += height.values[h]\n",
    "        elif 160 <= height.index[h] < 170:\n",
    "            height_count[2] += height.values[h]\n",
    "        elif 170 <= height.index[h] < 180:\n",
    "            height_count[3] += height.values[h]\n",
    "        elif 180 <= height.index[h] < 190:\n",
    "            height_count[4] += height.values[h]\n",
    "    return height_count\n",
    "\n",
    "# 绘制身高分布柱状图\n",
    "def draw_height_bar(data):\n",
    "    bar = Bar(\"妹子身高分布柱状图\")\n",
    "    bar.add(\"妹子身高\", height_interval, data, bar_category_gap=0, is_random=True, )\n",
    "    return bar\n",
    "\n",
    "draw_height_bar(analysis_height(raw_data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"f1c851ea31cd4473863c29a34677fee6\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_f1c851ea31cd4473863c29a34677fee6 = echarts.init(document.getElementById('f1c851ea31cd4473863c29a34677fee6'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_f1c851ea31cd4473863c29a34677fee6 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u8eab\\u9ad8\\u5206\\u5e03\\u997c\\u56fe-\\u5706\\u73af\\u56fe\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 7804870,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"140\",\n",
       "                    \"value\": 8.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"150\",\n",
       "                    \"value\": 3837.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"160\",\n",
       "                    \"value\": 9680.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"170\",\n",
       "                    \"value\": 789.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"180\",\n",
       "                    \"value\": 11.0\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"outside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    },\n",
       "                    \"formatter\": \"{b}: {d}%\"\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 7804870\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"140\",\n",
       "                \"150\",\n",
       "                \"160\",\n",
       "                \"170\",\n",
       "                \"180\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"left\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#749f83\",\n",
       "        \"#726930\",\n",
       "        \"#bda29a\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ca8622\",\n",
       "        \"#b2d235\",\n",
       "        \"#c23531\",\n",
       "        \"#ac6767\",\n",
       "        \"#fab27b\",\n",
       "        \"#61a0a8\",\n",
       "        \"#2f4554\",\n",
       "        \"#444693\",\n",
       "        \"#d48265\",\n",
       "        \"#6e7074\",\n",
       "        \"#f6f5ec\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#2a5caa\",\n",
       "        \"#918597\",\n",
       "        \"#546570\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#6d8346\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\"\n",
       "    ]\n",
       "};\n",
       "myChart_f1c851ea31cd4473863c29a34677fee6.setOption(option_f1c851ea31cd4473863c29a34677fee6);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.pie.Pie at 0x1072f30>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Pie\n",
    "\n",
    "# 绘制身高分布饼图\n",
    "def draw_height_pie(data):\n",
    "    pie = Pie(\"妹子身高分布饼图-圆环图\", title_pos='center')\n",
    "    pie.add(\"\", height_interval, data, radius=[40, 75], label_text_color=None,\n",
    "            is_label_show=True, legend_orient='vertical', is_random=True,\n",
    "            legend_pos='left')\n",
    "    return pie\n",
    "\n",
    "draw_height_pie(analysis_height(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3.分析学历\n",
    "\n",
    "接着分析一下学历的情况，这里我们用到漏斗图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"a09b823cff6f40eaa2debb78015c7d29\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_a09b823cff6f40eaa2debb78015c7d29 = echarts.init(document.getElementById('a09b823cff6f40eaa2debb78015c7d29'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_a09b823cff6f40eaa2debb78015c7d29 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u5b66\\u5386\\u5206\\u5e03\\u6f0f\\u6597\\u56fe\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"center\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 6435746,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"name\": \"\\u5b66\\u5386\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u672c\\u79d1\",\n",
       "                    \"value\": 5439\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5927\\u4e13\",\n",
       "                    \"value\": 4826\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ad8\\u4e2d\",\n",
       "                    \"value\": 1460\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e2d\\u4e13\",\n",
       "                    \"value\": 1170\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u521d\\u4e2d\",\n",
       "                    \"value\": 817\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7855\\u58eb\",\n",
       "                    \"value\": 602\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u535a\\u58eb\",\n",
       "                    \"value\": 22\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9662\\u58eb\",\n",
       "                    \"value\": 4\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"textStyle\": {\n",
       "                        \"color\": \"#fff\",\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u535a\\u58eb\",\n",
       "                \"\\u4e2d\\u4e13\",\n",
       "                \"\\u5927\\u4e13\",\n",
       "                \"\\u7855\\u58eb\",\n",
       "                \"\\u672c\\u79d1\",\n",
       "                \"\\u521d\\u4e2d\",\n",
       "                \"\\u9662\\u58eb\",\n",
       "                \"\\u9ad8\\u4e2d\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#749f83\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#444693\",\n",
       "        \"#f05b72\",\n",
       "        \"#905a3d\",\n",
       "        \"#ca8622\",\n",
       "        \"#726930\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#c23531\",\n",
       "        \"#6d8346\",\n",
       "        \"#2f4554\",\n",
       "        \"#6e7074\",\n",
       "        \"#918597\",\n",
       "        \"#fab27b\",\n",
       "        \"#546570\",\n",
       "        \"#1d953f\",\n",
       "        \"#d48265\",\n",
       "        \"#ac6767\",\n",
       "        \"#f6f5ec\",\n",
       "        \"#bda29a\",\n",
       "        \"#6950a1\",\n",
       "        \"#2a5caa\",\n",
       "        \"#f47920\",\n",
       "        \"#61a0a8\",\n",
       "        \"#b2d235\"\n",
       "    ]\n",
       "};\n",
       "myChart_a09b823cff6f40eaa2debb78015c7d29.setOption(option_a09b823cff6f40eaa2debb78015c7d29);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.funnel.Funnel at 0xa958610>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Funnel\n",
    "\n",
    "# 学历范围\n",
    "edu_interval = ['本科', '大专', '高中', '中专', '初中', '硕士', '博士', '院士']  \n",
    "\n",
    "# 分析学历\n",
    "def analysis_edu(data):\n",
    "    return data['学历'].value_counts()\n",
    "\n",
    "# 学历漏斗图\n",
    "def draw_edu_funnel(data):\n",
    "    funnel = Funnel(\"妹子学历分布漏斗图\",title_top='center')\n",
    "    funnel.add(\"学历\", edu_interval, data, is_label_show=True,\n",
    "               label_pos=\"inside\", label_text_color=\"#fff\", is_random=True)\n",
    "    return funnel\n",
    "\n",
    "draw_edu_funnel(analysis_edu(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4.分析年龄情况\n",
    "\n",
    "接下来分析下都是些什么年龄段的妹子在找对象，这里还是先要过滤一些不合理的数据，\n",
    "筛选的合理年龄段范围为：1956-2000，分为五个年龄段：18-25，25-30，31-40，41-50和50以上。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"5e3b2a11662b45428e4bc89e81d63e4f\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_5e3b2a11662b45428e4bc89e81d63e4f = echarts.init(document.getElementById('5e3b2a11662b45428e4bc89e81d63e4f'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_5e3b2a11662b45428e4bc89e81d63e4f = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u59b9\\u5b50\\u5e74\\u9f84\\u5206\\u5e03\\u96f7\\u8fbe\\u56fe\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 1444959,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"radar\",\n",
       "            \"name\": \"\\u5e74\\u9f84\\u6bb5\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    4016.0,\n",
       "                    6618.0,\n",
       "                    3218.0,\n",
       "                    386.0,\n",
       "                    81.0\n",
       "                ]\n",
       "            ],\n",
       "            \"symbol\": \"circle\",\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {}\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5e74\\u9f84\\u6bb5\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"radar\": {\n",
       "        \"indicator\": [\n",
       "            {\n",
       "                \"name\": \"18-25\",\n",
       "                \"max\": 8000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"26-30\",\n",
       "                \"max\": 8000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"31-40\",\n",
       "                \"max\": 8000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"41-50\",\n",
       "                \"max\": 8000\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"50\\u4ee5\\u4e0a\",\n",
       "                \"max\": 8000\n",
       "            }\n",
       "        ],\n",
       "        \"name\": {\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#333\",\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        },\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        \"splitArea\": {\n",
       "            \"show\": true,\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 1\n",
       "            }\n",
       "        },\n",
       "        \"axisLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_5e3b2a11662b45428e4bc89e81d63e4f.setOption(option_5e3b2a11662b45428e4bc89e81d63e4f);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.radar.Radar at 0x4cbf210>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Radar\n",
    "\n",
    "# 年龄范围\n",
    "age_interval = [\n",
    "    ('18-25', 8000), ('26-30', 8000), ('31-40', 8000),\n",
    "    ('41-50', 8000), ('50以上', 8000),\n",
    "]\n",
    "\n",
    "# 分析年龄\n",
    "def analysis_age(data):\n",
    "    age_data = data['出生年份']\n",
    "    age = (age_data.loc[(age_data >= 1956) & (age_data <= 2000)]).value_counts().sort_index()\n",
    "    age_count = [[0, 0, 0, 0, 0]]\n",
    "    for h in range(0, len(age)):\n",
    "        if 1993 <= age.index[h] <= 2000:\n",
    "            age_count[0][0] += age.values[h]\n",
    "        elif 1988 <= age.index[h] <= 1992:\n",
    "            age_count[0][1] += age.values[h]\n",
    "        elif 1978 <= age.index[h] <= 1987:\n",
    "            age_count[0][2] += age.values[h]\n",
    "        elif 1968 <= age.index[h] <= 1977:\n",
    "            age_count[0][3] += age.values[h]\n",
    "        elif age.index[h] < 1968:\n",
    "            age_count[0][4] += age.values[h]\n",
    "    return age_count\n",
    "\n",
    "# 年龄雷达图\n",
    "def draw_age_radar(data):\n",
    "    radar = Radar(\"妹子年龄分布雷达图\")\n",
    "    radar.config(age_interval)\n",
    "    radar.add(\"年龄段\", data, is_area_show=False, is_splitline_show='single')\n",
    "    return radar\n",
    "\n",
    "draw_age_radar(analysis_age(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 5.分析城市分布\n",
    "\n",
    "接着我们来分析下找对象妹子的城市分布，这里用到了地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min', 'china': '/nbextensions/echarts-countries-js/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"538ad9b49ed848b8931937da0b6346e4\" style=\"width:1200px;height:600px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'china'], function(echarts) {\n",
       "        \n",
       "var myChart_538ad9b49ed848b8931937da0b6346e4 = echarts.init(document.getElementById('538ad9b49ed848b8931937da0b6346e4'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_538ad9b49ed848b8931937da0b6346e4 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5168\\u56fd\\u59b9\\u5b50\\u5206\\u5e03\\u57ce\\u5e02\",\n",
       "            \"subtext\": \"\\u5236\\u4f5c\\u4eba\\uff1aCoderPig\",\n",
       "            \"left\": \"left\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#fff\",\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4204173,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"formatter\": \"{b}: {c}\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbol\": \"circle\",\n",
       "            \"symbolSize\": 15,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        2378.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6df1\\u5733\",\n",
       "                    \"value\": [\n",
       "                        114.07,\n",
       "                        22.62,\n",
       "                        2130.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.48,\n",
       "                        31.22,\n",
       "                        2093.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.46,\n",
       "                        39.92,\n",
       "                        1072.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u957f\\u6c99\",\n",
       "                    \"value\": [\n",
       "                        113,\n",
       "                        28.21,\n",
       "                        718.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u676d\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        120.19,\n",
       "                        30.26,\n",
       "                        675.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5357\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        118.78,\n",
       "                        32.04,\n",
       "                        588.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u53a6\\u95e8\",\n",
       "                    \"value\": [\n",
       "                        118.1,\n",
       "                        24.46,\n",
       "                        557.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        119.3,\n",
       "                        26.08,\n",
       "                        546.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6210\\u90fd\",\n",
       "                    \"value\": [\n",
       "                        104.06,\n",
       "                        30.67,\n",
       "                        470.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6b66\\u6c49\",\n",
       "                    \"value\": [\n",
       "                        114.31,\n",
       "                        30.52,\n",
       "                        400.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u5c9b\",\n",
       "                    \"value\": [\n",
       "                        120.33,\n",
       "                        36.07,\n",
       "                        252.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": [\n",
       "                        106.54,\n",
       "                        29.59,\n",
       "                        233.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d4e\\u5357\",\n",
       "                    \"value\": [\n",
       "                        117,\n",
       "                        36.65,\n",
       "                        201.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u82cf\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        120.62,\n",
       "                        31.32,\n",
       "                        178.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e1c\\u839e\",\n",
       "                    \"value\": [\n",
       "                        113.75,\n",
       "                        23.04,\n",
       "                        92.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4f5b\\u5c71\",\n",
       "                    \"value\": [\n",
       "                        113.11,\n",
       "                        23.05,\n",
       "                        85.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u90d1\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.65,\n",
       "                        34.76,\n",
       "                        48.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9999\\u6e2f\",\n",
       "                    \"value\": [\n",
       "                        115.12,\n",
       "                        21.23,\n",
       "                        45.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u5b89\",\n",
       "                    \"value\": [\n",
       "                        108.95,\n",
       "                        34.27,\n",
       "                        43.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u60e0\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        114.4,\n",
       "                        23.09,\n",
       "                        40.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u9633\",\n",
       "                    \"value\": [\n",
       "                        106.71,\n",
       "                        26.57,\n",
       "                        38.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5357\\u660c\",\n",
       "                    \"value\": [\n",
       "                        115.89,\n",
       "                        28.68,\n",
       "                        34.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5408\\u80a5\",\n",
       "                    \"value\": [\n",
       "                        117.27,\n",
       "                        31.86,\n",
       "                        34.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8302\\u540d\",\n",
       "                    \"value\": [\n",
       "                        110.88,\n",
       "                        21.68,\n",
       "                        33.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cc9\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        118.58,\n",
       "                        24.93,\n",
       "                        32.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6606\\u660e\",\n",
       "                    \"value\": [\n",
       "                        102.73,\n",
       "                        25.04,\n",
       "                        31.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e5b\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        110.359377,\n",
       "                        21.270708,\n",
       "                        31.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e29\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        120.65,\n",
       "                        28.01,\n",
       "                        30.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u73e0\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        113.52,\n",
       "                        22.3,\n",
       "                        29.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5357\\u5b81\",\n",
       "                    \"value\": [\n",
       "                        108.33,\n",
       "                        22.84,\n",
       "                        28.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u6ce2\",\n",
       "                    \"value\": [\n",
       "                        121.56,\n",
       "                        29.86,\n",
       "                        27.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u77f3\\u5bb6\\u5e84\",\n",
       "                    \"value\": [\n",
       "                        114.48,\n",
       "                        38.03,\n",
       "                        25.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u63ed\\u9633\",\n",
       "                    \"value\": [\n",
       "                        116.35,\n",
       "                        23.55,\n",
       "                        22.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c55\\u5934\",\n",
       "                    \"value\": [\n",
       "                        116.69,\n",
       "                        23.39,\n",
       "                        22.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": [\n",
       "                        117.2,\n",
       "                        39.13,\n",
       "                        22.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e2d\\u5c71\",\n",
       "                    \"value\": [\n",
       "                        113.38,\n",
       "                        22.52,\n",
       "                        21.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c88\\u9633\",\n",
       "                    \"value\": [\n",
       "                        123.38,\n",
       "                        41.8,\n",
       "                        20.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u682a\\u6d32\",\n",
       "                    \"value\": [\n",
       "                        113.16,\n",
       "                        27.83,\n",
       "                        18.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5170\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        103.73,\n",
       "                        36.03,\n",
       "                        18.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e05\\u8fdc\",\n",
       "                    \"value\": [\n",
       "                        113.01,\n",
       "                        23.7,\n",
       "                        17.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5357\\u901a\",\n",
       "                    \"value\": [\n",
       "                        121.05,\n",
       "                        32.08,\n",
       "                        17.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65e0\\u9521\",\n",
       "                    \"value\": [\n",
       "                        120.29,\n",
       "                        31.59,\n",
       "                        15.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u90f4\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.02,\n",
       "                        25.46,\n",
       "                        15.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u95e8\",\n",
       "                    \"value\": [\n",
       "                        113.06,\n",
       "                        22.61,\n",
       "                        15.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u54c8\\u5c14\\u6ee8\",\n",
       "                    \"value\": [\n",
       "                        126.63,\n",
       "                        45.75,\n",
       "                        14.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u53e3\",\n",
       "                    \"value\": [\n",
       "                        110.35,\n",
       "                        20.02,\n",
       "                        14.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u957f\\u6625\",\n",
       "                    \"value\": [\n",
       "                        125.35,\n",
       "                        43.88,\n",
       "                        14.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5cb3\\u9633\",\n",
       "                    \"value\": [\n",
       "                        113.09,\n",
       "                        29.37,\n",
       "                        14.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u592a\\u539f\",\n",
       "                    \"value\": [\n",
       "                        112.53,\n",
       "                        37.87,\n",
       "                        13.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6f33\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        117.39,\n",
       "                        24.31,\n",
       "                        13.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91d1\\u534e\",\n",
       "                    \"value\": [\n",
       "                        119.64,\n",
       "                        29.12,\n",
       "                        13.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8861\\u9633\",\n",
       "                    \"value\": [\n",
       "                        112.37,\n",
       "                        26.53,\n",
       "                        12.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6dee\\u5b89\",\n",
       "                    \"value\": [\n",
       "                        119.15,\n",
       "                        33.5,\n",
       "                        12.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9f99\\u5ca9\",\n",
       "                    \"value\": [\n",
       "                        117.01,\n",
       "                        25.06,\n",
       "                        11.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5e86\",\n",
       "                    \"value\": [\n",
       "                        117.02,\n",
       "                        30.31,\n",
       "                        11.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7ecd\\u5174\",\n",
       "                    \"value\": [\n",
       "                        120.58,\n",
       "                        30.01,\n",
       "                        11.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6842\\u6797\",\n",
       "                    \"value\": [\n",
       "                        110.28,\n",
       "                        25.29,\n",
       "                        11.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e38\\u5fb7\",\n",
       "                    \"value\": [\n",
       "                        111.69,\n",
       "                        29.05,\n",
       "                        11.0\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e58\\u6f6d\",\n",
       "                    \"value\": [\n",
       "                        112.91,\n",
       "                        27.87,\n",
       "                        11.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"backgroundColor\": \"#404a59\",\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"label\": {\n",
       "            \"emphasis\": {\n",
       "                \"show\": true,\n",
       "                \"textStyle\": {\n",
       "                    \"color\": \"#eee\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        \"itemStyle\": {\n",
       "            \"normal\": {\n",
       "                \"areaColor\": \"#323c48\",\n",
       "                \"borderColor\": \"#111\"\n",
       "            },\n",
       "            \"emphasis\": {\n",
       "                \"areaColor\": \"#2a333d\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 10,\n",
       "        \"max\": 2500,\n",
       "        \"text\": [\n",
       "            \"high\",\n",
       "            \"low\"\n",
       "        ],\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#fff\"\n",
       "        },\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"left\",\n",
       "        \"top\": \"bottom\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "myChart_538ad9b49ed848b8931937da0b6346e4.setOption(option_538ad9b49ed848b8931937da0b6346e4);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.geo.Geo at 0xb5d8c10>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import Geo\n",
    "\n",
    "# 分析城市分布\n",
    "def analysis_city(data):\n",
    "    city_data = data['城市'].value_counts()\n",
    "    city_list = []\n",
    "    for city in range(0, len(city_data)):\n",
    "        if city_data.values[city] > 10 and city_data.index[city] != '国外' :\n",
    "            city_list.append((city_data.index[city], city_data.values[city]))\n",
    "    return city_list\n",
    "\n",
    "# 城市分布地图\n",
    "def draw_city_geo(data):\n",
    "    geo = Geo(\"全国妹子分布城市\", \"制作人：CoderPig\", title_color=\"#fff\",\n",
    "              title_pos=\"left\", width=1200,\n",
    "              height=600, background_color='#404a59')\n",
    "    attr, value = geo.cast(data)\n",
    "    geo.add(\"\", attr, value, visual_range=[10, 2500], visual_text_color=\"#fff\",\n",
    "            symbol_size=15, is_visualmap=True)\n",
    "    return geo\n",
    "\n",
    "draw_city_geo(analysis_city(raw_data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 6.分析交友宣言\n",
    "\n",
    "接着我们来分析下妹子们的交友宣言，看看妹子们都喜欢怎么样的男生，需要过滤一下网站默认的交友宣言，一般自己写的都是不会重复的，这个可以利用pandas.value_counts()，只保留出现一次的交友宣言，然后利用Jieba分词，Counter统计词频，剔除标点和特殊符号，同时过滤掉一些无意义的无用词，然后取频次最高的100个关键词，绘制成词云，以此了解妹子们的喜好。具体代码如下："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min', 'wordcloud': '/nbextensions/echarts/echarts-wordcloud.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"b10ab74f21264a0d9e6405662e9a54e0\" style=\"width:900px;height:720px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts', 'wordcloud'], function(echarts) {\n",
       "        \n",
       "var myChart_b10ab74f21264a0d9e6405662e9a54e0 = echarts.init(document.getElementById('b10ab74f21264a0d9e6405662e9a54e0'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_b10ab74f21264a0d9e6405662e9a54e0 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4e0b\\u8f7d\\u56fe\\u7247\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 2146794,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"wordCloud\",\n",
       "            \"shape\": \"circle\",\n",
       "            \"rotationRange\": [\n",
       "                -90,\n",
       "                90\n",
       "            ],\n",
       "            \"rotationStep\": 45,\n",
       "            \"girdSize\": 20,\n",
       "            \"sizeRange\": [\n",
       "                20,\n",
       "                100\n",
       "            ],\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u8d23\\u4efb\\u5fc3\",\n",
       "                    \"value\": 243,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(116,124,121)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u8fdb\\u5fc3\",\n",
       "                    \"value\": 188,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(120,153,15)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u70ed\\u7231\\u751f\\u6d3b\",\n",
       "                    \"value\": 86,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(2,81,90)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6027\\u683c\\u5f00\\u6717\",\n",
       "                    \"value\": 81,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(157,131,6)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u813e\\u6c14\\u597d\",\n",
       "                    \"value\": 66,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(106,127,133)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7b80\\u7b80\\u5355\\u5355\",\n",
       "                    \"value\": 55,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(15,147,138)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d23\\u4efb\\u611f\",\n",
       "                    \"value\": 52,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(135,114,137)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e8b\\u4e1a\\u5fc3\",\n",
       "                    \"value\": 48,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(12,115,116)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b5d\\u987a\\u7236\\u6bcd\",\n",
       "                    \"value\": 42,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(24,109,16)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e73\\u5e73\\u6de1\\u6de1\",\n",
       "                    \"value\": 40,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(107,21,77)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5168\\u611f\",\n",
       "                    \"value\": 39,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(133,129,136)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5584\\u89e3\\u4eba\\u610f\",\n",
       "                    \"value\": 39,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(154,31,130)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6267\\u5b50\\u4e4b\\u624b\",\n",
       "                    \"value\": 39,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(99,85,80)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5fd7\\u540c\\u9053\\u5408\",\n",
       "                    \"value\": 38,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(125,47,34)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d3b\\u6cfc\\u5f00\\u6717\",\n",
       "                    \"value\": 37,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(76,9,153)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u672c\\u5730\\u4eba\",\n",
       "                    \"value\": 36,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(29,37,14)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7fbd\\u6bdb\\u7403\",\n",
       "                    \"value\": 35,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(46,144,58)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7ec6\\u6c34\\u957f\\u6d41\",\n",
       "                    \"value\": 35,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(151,35,148)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0e\\u5b50\\u5055\\u8001\",\n",
       "                    \"value\": 35,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(17,57,139)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u79ef\\u6781\\u5411\\u4e0a\",\n",
       "                    \"value\": 35,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(34,119,117)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4ef7\\u503c\\u89c2\",\n",
       "                    \"value\": 33,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(39,122,101)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u7f3a\\u6bcb\\u6ee5\",\n",
       "                    \"value\": 33,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(144,72,103)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b5d\\u656c\\u7236\\u6bcd\",\n",
       "                    \"value\": 30,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(16,106,81)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e29\\u67d4\\u4f53\\u8d34\",\n",
       "                    \"value\": 30,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(11,16,89)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u62e9\\u4e00\\u57ce\",\n",
       "                    \"value\": 28,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(94,31,107)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u76f8\\u6fe1\\u4ee5\\u6cab\",\n",
       "                    \"value\": 27,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(29,62,28)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6652\\u592a\\u9633\",\n",
       "                    \"value\": 27,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(84,60,144)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5408\\u5f97\\u6765\",\n",
       "                    \"value\": 26,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(59,59,6)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5171\\u540c\\u8bed\\u8a00\",\n",
       "                    \"value\": 25,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(94,134,64)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u767d\\u5934\\u5055\\u8001\",\n",
       "                    \"value\": 24,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(65,56,133)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u672c\\u79d1\\u6bd5\\u4e1a\",\n",
       "                    \"value\": 23,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(39,42,13)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u70ed\\u6c14\\u817e\\u817e\",\n",
       "                    \"value\": 23,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(62,21,44)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5305\\u5bb9\\u5fc3\",\n",
       "                    \"value\": 22,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(149,114,90)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7ecf\\u6d4e\\u57fa\\u7840\",\n",
       "                    \"value\": 22,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(37,62,81)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8eab\\u4efd\\u8bc1\",\n",
       "                    \"value\": 22,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(89,61,129)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e92\\u76f8\\u7406\\u89e3\",\n",
       "                    \"value\": 21,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(42,60,50)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u987a\\u5176\\u81ea\\u7136\",\n",
       "                    \"value\": 21,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(151,144,124)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f70\\u8f70\\u70c8\\u70c8\",\n",
       "                    \"value\": 19,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(155,72,80)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\\u7701\",\n",
       "                    \"value\": 19,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(149,87,141)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5fd7\\u8da3\\u76f8\\u6295\",\n",
       "                    \"value\": 18,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(154,146,107)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u76f8\\u4e92\\u7406\\u89e3\",\n",
       "                    \"value\": 18,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(33,137,158)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5fc3\\u5730\\u5584\\u826f\",\n",
       "                    \"value\": 18,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(122,85,45)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8e0f\\u8e0f\\u5b9e\\u5b9e\",\n",
       "                    \"value\": 17,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(39,72,77)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8eab\\u4f53\\u5065\\u5eb7\",\n",
       "                    \"value\": 17,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(140,22,143)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e00\\u751f\\u4e00\\u4e16\",\n",
       "                    \"value\": 17,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(83,26,109)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7d\\u9ed8\\u611f\",\n",
       "                    \"value\": 16,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(131,77,107)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5f00\\u5f00\\u5fc3\\u5fc3\",\n",
       "                    \"value\": 16,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(97,60,110)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5927\\u7537\\u5b50\\u4e3b\\u4e49\",\n",
       "                    \"value\": 15,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(47,70,117)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5171\\u540c\\u8bdd\\u9898\",\n",
       "                    \"value\": 15,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(55,130,46)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5171\\u540c\\u7231\\u597d\",\n",
       "                    \"value\": 15,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(105,18,77)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6162\\u70ed\\u578b\",\n",
       "                    \"value\": 15,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(79,108,59)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u771f\\u5fc3\\u5b9e\\u610f\",\n",
       "                    \"value\": 15,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(65,147,10)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e00\\u89c1\\u949f\\u60c5\",\n",
       "                    \"value\": 14,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(71,68,57)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u767d\\u7f8a\\u5ea7\",\n",
       "                    \"value\": 14,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(98,35,158)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0d\\u597d\\u610f\\u601d\",\n",
       "                    \"value\": 14,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(114,83,126)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8ba4\\u771f\\u5bf9\\u5f85\",\n",
       "                    \"value\": 14,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(24,158,34)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0b\\u534a\\u751f\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(157,60,150)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u770b\\u770b\\u4e66\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(149,19,113)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u547d\\u4e2d\\u6ce8\\u5b9a\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(86,38,53)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5f00\\u82b1\\u7ed3\\u679c\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(129,117,49)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c0f\\u5973\\u5b50\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(32,136,13)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5bb6\\u5ead\\u548c\\u7766\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(139,160,92)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u73a9\\u6e38\\u620f\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(52,15,44)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6709\\u8f66\\u6709\\u623f\",\n",
       "                    \"value\": 13,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(77,115,115)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6709\\u7f18\\u5343\\u91cc\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(19,94,68)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c0f\\u5bb6\\u5ead\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(32,71,123)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5904\\u5973\\u5ea7\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(89,69,136)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u771f\\u8bda\\u76f8\\u5f85\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(123,100,41)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5343\\u7bc7\\u4e00\\u5f8b\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(87,93,79)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u672c\\u79d1\\u5b66\\u5386\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(154,37,50)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u95e8\\u5f53\\u6237\\u5bf9\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(68,40,107)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5171\\u540c\\u8fdb\\u6b65\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(70,54,83)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5de8\\u87f9\\u5ea7\",\n",
       "                    \"value\": 12,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(20,65,85)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c0f\\u4f19\\u4f34\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(137,63,96)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6027\\u683c\\u5916\\u5411\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(113,109,119)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u706f\\u706b\\u9611\\u73ca\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(32,78,67)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7ed3\\u5a5a\\u7684\\u4eba\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(96,126,129)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u540c\\u7518\\u5171\\u82e6\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(19,7,84)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8ba4\\u8ba4\\u771f\\u771f\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(32,20,124)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5927\\u5b66\\u6bd5\\u4e1a\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(158,27,142)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u771f\\u5fc3\\u771f\\u610f\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(139,117,91)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u767d\\u9a6c\\u738b\\u5b50\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(112,96,34)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u72ee\\u5b50\\u5ea7\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(137,91,32)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u901a\\u60c5\\u8fbe\\u7406\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(110,87,132)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6237\\u5916\\u6d3b\\u52a8\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(160,158,82)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7814\\u7a76\\u751f\",\n",
       "                    \"value\": 11,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(16,24,141)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0d\\u671f\\u800c\\u9047\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(102,68,6)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u624b\\u7275\\u624b\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(145,10,91)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u72ec\\u751f\\u5973\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(103,11,39)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5927\\u81ea\\u7136\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(79,78,126)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c0f\\u65e5\\u5b50\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(87,157,76)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4ea4\\u9645\\u5708\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(111,86,132)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u751f\\u6d3b\\u4e60\\u60ef\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(129,66,113)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5de5\\u7a0b\\u5e08\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(62,133,36)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e8b\\u4e1a\\u5355\\u4f4d\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(15,127,2)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u72ec\\u7acb\\u81ea\\u4e3b\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(17,145,25)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e00\\u5fc3\\u4e00\\u610f\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(14,101,34)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5355\\u4eb2\\u5bb6\\u5ead\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(120,127,88)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e94\\u5b98\\u7aef\\u6b63\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(97,104,70)\"\n",
       "                        }\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u767d\\u5934\\u5230\\u8001\",\n",
       "                    \"value\": 10,\n",
       "                    \"textStyle\": {\n",
       "                        \"normal\": {\n",
       "                            \"color\": \"rgb(150,5,21)\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_b10ab74f21264a0d9e6405662e9a54e0.setOption(option_b10ab74f21264a0d9e6405662e9a54e0);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.wordcloud.WordCloud at 0xbb5be90>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import WordCloud\n",
    "import re\n",
    "import jieba as jb\n",
    "from collections import Counter\n",
    "\n",
    "# 过滤标点的正则\n",
    "word_pattern = re.compile('[\\s+\\.\\!\\/_,$%^*(+\\\"\\']+|[+——！，。？“”、~@#￥%……&*（）(\\d+)]+')\n",
    "# 过滤无用词\n",
    "exclude_words = [\n",
    "            '一辈子', '不相离', '另一半', '业余时间', '性格特点', '茫茫人海', '男朋友', '找对象',\n",
    "            '谈恋爱', '有时候', '女孩子', '哈哈哈', '加微信', '兴趣爱好',\n",
    "            '是因为', '不良嗜好', '男孩子', '为什么', '没关系', '不介意',\n",
    "            '没什么', '交朋友', '大大咧咧', '大富大贵', '联系方式', '打招呼',\n",
    "            '有意者', '晚一点', '哈哈哈', '以上学历', '是不是', '给我发',\n",
    "            '不怎么', '第一次', '越来越', '遇一人', '择一人', '无数次',\n",
    "            '符合条件', '什么样', '全世界', '比较简单', '浪费时间', '不知不觉',\n",
    "            '有没有', '寻寻觅觅', '自我介绍', '请勿打扰', '差不多', '不在乎', '看起来',\n",
    "            '一点点', '陪你到', '这么久', '看清楚', '身高体重', '比较慢', '比较忙',\n",
    "            '多一点', '小女生', '土生土长', '发消息', '最合适','有缘人','过日子'\n",
    "        ]\n",
    "\n",
    "# 词频分布\n",
    "def analysis_word(data):\n",
    "    word_data = data['交友宣言'].value_counts()\n",
    "    word_list = []\n",
    "    for word in range(0, len(word_data)):\n",
    "        if word_data.values[word] == 1:\n",
    "            word_list.append(word_data.index[word])\n",
    "    return word_list\n",
    "\n",
    "\n",
    "# 绘制交友宣言词云\n",
    "def draw_word_wc(name, count):\n",
    "    wc = WordCloud(width=900, height=720)\n",
    "    wc.add(\"\", name, count, word_size_range=[20, 100], shape='circle')\n",
    "    return wc\n",
    "    \n",
    "word_result = word_pattern.sub(\"\", ''.join(analysis_word(raw_data)))\n",
    "words = [word for word in jb.cut(word_result, cut_all=False) if len(word) >= 3]\n",
    "# 遍历过滤掉无用词\n",
    "for i in range(0, len(words)):\n",
    "    if words[i] in exclude_words:\n",
    "        words[i] = None\n",
    "filter_list = list(filter(lambda t: t is not None, words))\n",
    "data = r' '.join(filter_list)\n",
    "# 词频统计\n",
    "c = Counter(filter_list)\n",
    "word_name = []  # 词\n",
    "word_count = []  # 词频\n",
    "for word_freq in c.most_common(100):\n",
    "    word, freq = word_freq\n",
    "    word_name.append(word)\n",
    "    word_count.append(freq)\n",
    "    \n",
    "draw_word_wc(word_name, word_count)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
